package org.pine.dictionary.bean.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.pine.dictionary.common.StatusEnum;

import javax.validation.constraints.NotBlank;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 字典查询响应体
 * </p>
 *
 * @author pine
 * @since 2024-05-16
 */
@Schema(title = "字典查询响应体")
@Data
public class DictionaryQueryResponse implements Serializable {
    @Serial
    private static final long serialVersionUID = -7837863768075359374L;

    /**
     * 字典ID
     */
    @JsonProperty("dictionaryId")
    @Schema(title = "dictionaryId", description = "字典ID")
    private String dictionaryId;

    /**
     * 编码
     */
    @NotBlank(message = "编码不能为空")
    @Schema(title = "code", description = "编码")
    private String code;

    /**
     * 名称
     */
    @Schema(title = "name", description = "名称")
    private String name;

    /**
     * 状态: 1=启用，0=禁用
     * @see StatusEnum
     */
    @JsonSerialize(using = StatusEnum.JsonSerializer.class)
    @JsonDeserialize(using = StatusEnum.JsonDeserializer.class)
    @Schema(title = "status", description = "状态: 1=启用，0=禁用")
    private StatusEnum status;

    /**
     * 备注
     */
    @Schema(title = "remark", description = "备注")
    private String remark;

    /**
     * 创建人用户名
     */
    @Schema(title = "createUsername", description = "创建人用户名")
    private String createUsername;

    /**
     * 创建时间
     */
    @Schema(title = "createTime", description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人用户名
     */
    @Schema(title = "updateUsername", description = "更新人用户名")
    private String updateUsername;

    /**
     * 更新时间
     */
    @Schema(title = "updateTime", description = "更新时间")
    private LocalDateTime updateTime;

}
